﻿using CommunityToolkit.Mvvm.ComponentModel;
using GameView.Comment;
using GameView.Models;
using GameView.Services.Dtos.WithdrawalDto;

namespace GameView.Services.Comment
{
    public partial class StatisticsService : ObservableObject
    {
        [ObservableProperty]
        private bool _isLoading;
        public StatisticsService()
        {
        }
        public async Task<ApiResponse<List<StatisticsEntity>>> GetByProjectAsync(WithdrawalQueryDto queryDto)
        {
            var res = await $"{APIHelper.Statistics}/statistic-by-project".PostAsync<List<StatisticsEntity>, WithdrawalQueryDto>(queryDto);
            return res;
        }
        public async Task<ApiResponse<List<StatisticsEntity>>> GetProjectDetailAsync(WithdrawalQueryDto queryDto)
        {
            var res = await $"{APIHelper.Statistics}/statistic-by-project-detail".PostAsync<List<StatisticsEntity>, WithdrawalQueryDto>(queryDto);
            return res;
        }
        public async Task<ApiResponse<List<StatisticsEntity>>> GetByMerchantAsync(WithdrawalQueryDto queryDto)
        {
            var res = await $"{APIHelper.Statistics}/statistic-by-merchant".PostAsync<List<StatisticsEntity>, WithdrawalQueryDto>(queryDto);
            return res;
        }
        public async Task<ApiResponse<List<StatisticsEntity>>> GetMerchantDetailAsync(WithdrawalQueryDto queryDto)
        {
            var res = await $"{APIHelper.Statistics}/statistic-by-merchant-detail".PostAsync<List<StatisticsEntity>, WithdrawalQueryDto>(queryDto);
            return res;
        }
    }
}